package com.cm.stock.manager.service;

import com.cm.stock.manager.dao.ArticleDAO;
import com.cm.stock.manager.dao.ClientDAO;
import com.cm.stock.manager.dao.CommandeDAO;
import com.cm.stock.manager.dao.FactureDAO;
import com.cm.stock.manager.dao.FamilleDAO;
import com.cm.stock.manager.dao.GroupeDAO;
import com.cm.stock.manager.dao.OperationDAO;
import com.cm.stock.manager.dao.PointVenteDAO;
import com.cm.stock.manager.dao.UserDAO;
import com.cm.stock.manager.dao.ArticleCommandeDAO;
import com.cm.stock.manager.dao.ArticleFactureDAO;

public class BeansService {
	private static ArticleDAO ARTICLEDAO;
	private static ClientDAO CLIENTDAO;
	private static CommandeDAO COMMANDEDAO;
	private static FactureDAO FACTUREDAO;
	private static FamilleDAO FAMILLEDAO;
	private static GroupeDAO GROUPEDAO;
	private static OperationDAO OPERATIONDAO;
	private static PointVenteDAO POINTVENTEDAO;
	private static UserDAO USERDAO;
	private static ArticleCommandeDAO ARTICLECOMMANDEDAO;
	private static ArticleFactureDAO ARTICLEFACTUREDAO;
	
	public static ArticleDAO getARTICLEDAO() {
		if(ARTICLEDAO==null)
			ARTICLEDAO = (ArticleDAO) BootstrapService.getCONTEXT().getBean("ArticleDAO");
		return ARTICLEDAO;
	}
	
	public static ClientDAO getCLIENTDAO() {
		if(CLIENTDAO==null)
			CLIENTDAO = (ClientDAO) BootstrapService.getCONTEXT().getBean("ClientDAO");
		return CLIENTDAO;
	}
	
	public static CommandeDAO getCOMMANDEDAO() {
		if(COMMANDEDAO==null)
			COMMANDEDAO = (CommandeDAO) BootstrapService.getCONTEXT().getBean("ComandeDAO");
		return COMMANDEDAO;
	}
	
	public static FactureDAO getFACTUREDAO() {
		if(FACTUREDAO==null)
			FACTUREDAO = (FactureDAO) BootstrapService.getCONTEXT().getBean("FactureDAO");
		return FACTUREDAO;
	}
	
	public static FamilleDAO getFAMILLEDAO() {
		if(FAMILLEDAO==null)
			FAMILLEDAO = (FamilleDAO) BootstrapService.getCONTEXT().getBean("FamilleDAO");
		return FAMILLEDAO;
	}
	
	public static GroupeDAO getGROUPEDAO() {
		if(GROUPEDAO==null)
			GROUPEDAO = (GroupeDAO) BootstrapService.getCONTEXT().getBean("GroupeDAO");
		return GROUPEDAO;
	}
	
	public static OperationDAO getOPERATIONDAO() {
		if(OPERATIONDAO==null)
			OPERATIONDAO = (OperationDAO) BootstrapService.getCONTEXT().getBean("OperationDAO");
		return OPERATIONDAO;
	}
	
	public static PointVenteDAO getPOINTVENTEDAO() {
		if(POINTVENTEDAO==null)
			POINTVENTEDAO = (PointVenteDAO) BootstrapService.getCONTEXT().getBean("PointVenteDAO");
		return POINTVENTEDAO;
	}
	
	public static UserDAO getUSERDAO() {
		if(USERDAO==null)
			USERDAO = (UserDAO) BootstrapService.getCONTEXT().getBean("UserDAO");
		return USERDAO;
	}
	
	public static ArticleCommandeDAO getARTICLECOMMANDEDAO() {
		if(ARTICLECOMMANDEDAO==null)
			ARTICLECOMMANDEDAO = (ArticleCommandeDAO) BootstrapService.getCONTEXT().getBean("ArticleCommandeDAO");
		return ARTICLECOMMANDEDAO;
	}
	
	public static ArticleFactureDAO getARTICLEFACTUREDAO() {
		if(ARTICLEFACTUREDAO==null)
			ARTICLEFACTUREDAO = (ArticleFactureDAO) BootstrapService.getCONTEXT().getBean("ArticleFactureDAO");
		return ARTICLEFACTUREDAO;
	}
}
